﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SvnUpdater
{
    class SVNUpdater
    {
        private SVNConfiguration config = null;
        public SVNUpdater(SVNConfiguration config){
            this.config = config;
            SetCurrentDirectory();
        }
        private void SetCurrentDirectory(){
            System.IO.Directory.SetCurrentDirectory(config.WorkingDirectory);
        }
        public SVNUpdater()
        {
            this.config = new SVNConfiguration();
            SetCurrentDirectory();
        }
        public void Update()
        {
            try{
                System.Diagnostics.Process.Start(config.Svnpath, "update");
            }catch(Exception ex){
                Console.WriteLine(ex.Message);
            }
        }
    }
}